<ui:composition template="/templates/layout.xhtml" xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jstl/core"
     xmlns:fmt="http://java.sun.com/jstl/fmt"
     xmlns:x="http://java.sun.com/jstl/xml"
     xmlns:fn="http://java.sun.com/jstl/functions"
     xmlns:a4j="http://richfaces.org/a4j"
     xmlns:rich="http://richfaces.org/rich"
     xmlns:gape="http://componentes.gape/component/gape">
     
	<ui:define name="titulo">
		<h:outputText value="#{msg.applicationName} - #{msg.titleStart} - #{msg.titleSurvey}" />
	</ui:define>

	<ui:define name="menu">
		<ui:include src="/menu/menuStrategicPlan.xhtml" />
	</ui:define>
	
	<ui:define name="conteudo">
		<h:panelGrid columns="1" footerClass="FormLinhaBotoes" headerClass="pathway" 
					 columnClasses="label,field,label,field">
			<f:facet name="header">
				<h:outputText value="#{msg.titleSurvey}" />
			</f:facet>
			
			<rich:dataTable id="survey" columnClasses="" headerClass="headTable" rowClasses="odd,even" value="#{survey.listaSurvey}" var="row" rowKeyVar="linha" rows="6">
				<rich:column width="120px">
					<f:facet name="header">
						<h:outputText value="#{msg.gettingStartedTitleSurveyGridDateColumn}"/>
					</f:facet>				
					<h:outputText value="#{row.dataString}"/>
				</rich:column>
				
				<rich:column width="120px">
					<f:facet name="header">
						<h:outputText value="#{msg.gettingStartedTitleSurveyGridScoreColumn}"/>
					</f:facet>				
					<h:outputText value="#{row.score}"/>
				</rich:column>
				
				<rich:column width="20px">
	            	<a4j:commandLink id="view" action="#{survey.viewSurvey}" reRender="panelSurveyView" oncomplete="javascript:Richfaces.showModalPanel('panelSurveyView');" 
	            					 styleClass="imageLink"> 
                    	<h:graphicImage value="/files/view.png" style="border:0" />
                        <f:setPropertyActionListener value="#{linha}" target="#{survey.valorSelecionado}" />
                    </a4j:commandLink>
                    <rich:toolTip for="view">
                    	<h:outputText value="#{msg.buttonView}" />
                    </rich:toolTip>		                    
            	</rich:column>
            	
	 			<f:facet name="footer">
	                <rich:datascroller maxPages="20">
	                </rich:datascroller>
	            </f:facet>
			</rich:dataTable>
			
			<a4j:commandLink value="#{msg.linkSubScoreSurvey}" oncomplete="javascript:Richfaces.showModalPanel('panel');"/>
		</h:panelGrid>		
	</ui:define>
	
	<ui:define name="menuTela">
		<ui:include src="menu.xhtml" />
	</ui:define>
	
	<ui:define name="menuNavegacaoBack">
		<gape:navigationBack mbean="#{'menu'}" metodo="#{'redirecionaTela'}" parameterValue="defineStrategicMembers" parameterTarget="#{menu.menuCode}" />
	</ui:define>
	
	<ui:define name="menuNavegacaoForward">
		<gape:navigationForward mbean="#{'menu'}" metodo="#{'redirecionaTela'}" parameterValue="definePerspectives" parameterTarget="#{menu.menuCode}" />
	</ui:define>	

	<ui:define name="includePanels">
		<ui:include src="panel.xhtml" />
		<ui:include src="panelSurvey.xhtml" />
		<ui:include src="panelSurveyView.xhtml" />
	</ui:define>
</ui:composition>